{extend name="layout" /}
{block name="body"}
 <div class="row">
  <div class="col-lg-12">
	<div class="card">
	  <div class="card-body">
		  <div class="form-group">
			<label for="zc_money">注册赠送积分</label>
			<input type="text" class="form-control" id="zc_money" value="{$app.zc_money}" placeholder="请输入注册赠送积分天数">
		  </div>
		  <div class="form-group">
			<label for="zc_vip">注册赠送会员</label>
			<input type="text" class="form-control" id="zc_vip" value="{$app.zc_vip}" placeholder="请输入注册赠送会员天数">
		  </div>
		  <div class="form-group">
			<label for="sign_money">签到赠送积分</label>
			<input type="text" class="form-control" id="sign_money" value="{$app.sign_money}" placeholder="请输入签到赠送积分数量">
		  </div>
		  <div class="form-group">
			<label for="sign_vip">签到赠送会员</label>
			<input type="text" class="form-control" id="sign_vip" value="{$app.sign_vip}" placeholder="请输入签到赠送会员天数">
		  </div>
		  <div class="form-group">
			<label for="invitation_money">邀请赠送积分</label>
			<input type="text" class="form-control" id="invitation_money" value="{$app.invitation_money}" placeholder="请输入签到赠送积分数量">
		  </div>
		  <div class="form-group">
			<label for="invitation_vip">邀请赠送会员</label>
			<input type="text" class="form-control" id="invitation_vip" value="{$app.invitation_vip}" placeholder="请输入签到赠送会员天数">
		  </div>
		  <button type="button" onclick="updateweb()" class="btn btn-w-sm btn-primary mb-2">提交</button>
		  <button type="button" class="btn btn-default mb-2" onclick="javascript:history.back(-1);return false;">返 回
		  </button>
	  </div>
	</div>
  </div>
</div>
{/block}
{block name="js"}
<script>
	function updateweb() {
	    var l = $('body').lyearloading({
	        opacity: 0.2,
	        spinnerSize: 'lg',
	        spinnerText: '后台处理中，请稍后...',
	        textColorClass: 'text-info',
	        spinnerColorClass: 'text-info'
	    });
		var zc_money = $.trim($("#zc_money").val());
		var zc_vip = $.trim($("#zc_vip").val());
		var sign_money = $.trim($("#sign_money").val());
		var sign_vip = $.trim($("#sign_vip").val());
		var invitation_money = $.trim($("#invitation_money").val());
		var invitation_vip = $.trim($("#invitation_vip").val());
	    $.ajax({
	        type: "POST",
	        url: "{:url('app/index')}",
	        data: {
	            zc_money:zc_money,
	            zc_vip:zc_vip,
	            sign_money:sign_money,
	            sign_vip:sign_vip,
	            invitation_money:invitation_money,
	            invitation_vip:invitation_vip
	        },
	        dataType: "json",
	        success: function (data) {
	            setTimeout(function () {
	                l.destroy();
	            }, 1e3)
	            if (data.code == 1) {
	                notify.success(data.msg);
	            } else {
	                notify.error(data.msg);
	            }
	        },
	        error: function () {
	            l.destroy();
	            notify.error("系统错误");
	        }
	    })
	}
</script>
{/block}